package com.rslai.base.tool.autotest.mock.model;

import com.rslai.base.tool.autotest.mock.util.ExtractValueUtils;

import java.util.Map;

public class Callback {
    private String url;
    private Map<String, String> headers;
    private String method;
    private String body;

    public Callback() {
    }

    public Callback(String url, String body) {
        this.url = url;
        this.body = body;
    }

    public String getUrl() {
        return this.url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Map<String, String> getHeaders() {
        return this.headers;
    }

    public void setHeaders(Map<String, String> headers) {
        this.headers = headers;
    }

    public String getMethod() {
        return this.method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getBody() {
        return this.body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    public String computeUrl(Map parameters) {
        return (String) ExtractValueUtils.extract(this.url, parameters);
    }
}

